package com.yc.sole.erp.exception;

import com.yc.sole.framework.result.IResultMsg;
import lombok.AllArgsConstructor;

/**
 * @author yizuomin
 * @date 2023/12/15 22:43
 **/
@AllArgsConstructor
public enum ErpResultEnum implements IResultMsg {

    MOLD_NOT_FOUND(10000, "模具不存在"),
    PROD_NAME_REPEAT(20001, "产品名称：{0}，重复"),
    IMAGE_CAN_NOT_BE_EMPTY(20002, "请上传图片信息"),
    PRODUCED_QUANTITY_ERROR(20003, "请输入正确的产量"),
    STOCK_NOT_ENOUGH(20004, "产品名称：{0}，库存不足"),
    REMAINING_QUANTITY_NOT_ENOUGH(20005, "剩余数量不足"),
    TEAM_EMPLOYEE_ERROR(20006, "当前班组已存在该员工"),
    ORDER_CAN_NOT_CANCEL(20008, "当前订单{0}，无法取消"),
    ORDER_CAN_NOT_DELETE(2009, "当前订单{0}，无法删除"),
    SHIFT_NOT_EXIST(20010, "班次不存在"),
    CATEGORY_OPTION_CAN_NOT_EMPTY(20011, "请输入分类属性,多个使用|分隔"),
    MANUALLY_ADDED_CAN_NOT_EMPTY(20012, "请选择是否可手动添加"),
    PRODUCE_NOT_SUSPEND(20013, "当前生产{0}，无法恢复生产"),
    PRODUCE_NOT_IN_PRODUCTION(20014, "当前生产{0}，无法暂停"),
    CATEGORY_NOT_FOUND(20015, "分类不存在"),
    CUSTOMER_NOT_FOUND(20016, "客户不存在"),
    EMPLOYEE_NOT_FOUND(20018, "员工信息不存在"),
    PROCESS_NOT_FOUND(20019, "工序不存在"),
    SUPPLIER_NOT_FOUND(20020, "供应商不存在"),
    PROD_CODE_REPEAT(20001, "产品编号重复"),
    OUTPUT_QUANTITY_ERROR(20003, "产量输入错误,当前输入数量:{0},剩余数量:{1}"),
    ORDER_CAN_NOT_UPDATE(2009, "当前订单{0}，无法修改"),
    ORDER_CAN_NOT_OUTSOURCING(2009, "当前订单{0}，无法将订单外发"),
    ORDER_CAN_NOT_TERMINATION(2009, "当前订单{0}，无法终止"),
    PRODUCE_COMPLETE_CAN_NOT_DELETE(20016, "当前生产{0}，无法删除"),
    PRODUCE_COMPLETE(20015, "生产完成，无法修改"),
    ORDER_STATE_CAN_NOT_PRODUCE(20015, "当前订单{0},无法生产"),
    SALE_ORDER_NOT_FOUND(20016, "销售订单信息不存在"),
    PRODUCE_NOT_FOUND(20017, "生产信息不存在"),
    STOCK_NOT_FOUND(20018, "库存信息不存在"),
    STOCK_OUT_NOT_FOUND(20018, "送货信息不存在"),
    OUTPUT_NOT_FOUND(20019, "产量信息不存在"),
    ORDER_QUANTITY_ERROR_CAN_NOT_UPDATE(20020, "当前订单已有产量:{0},订单数量无法修改为:{1}"),
    PRODUCE_CAN_NOT_DELETE(20021, "当前生产已生产{0}双,无法删除"),
    RECEIPT_AMOUNT_MORE_THAN_PAID_AMOUNT(40004, "操作失败,收款金额【{0}】大于订单总金额【{1}】"),
    RECEIPT_AMOUNT_MORE_THAN_PAID_AMOUNT_CAN_NOT_RETURN(40003, "退回已收款金额失败,退回金额【{0}】大于订单已收款金额【{1}】"),
    STOCK_DEDUCT_FAIL(40004, "扣库存失败，请稍后重试"),
    STOCK_IN_NOT_FOUND(40005, "入库信息不存在"),
    SALE_ORDER_SHIPPED_QUANTITY_NOT_ENOUGH(40006, "已送货数量不足"),
    SHIP_QUANTITY_MORE_THAN_ORDER_QUANTITY(40007, "操作失败，送货数量【{0}】已超过订单总数量【{1}】"),
    RECEIPT_AMOUNT_LESS_THAN_AMOUNT(40008, "操作失败,金额计算异常，【0】"),
    PRODUCE_REMAIN_QUANTITY_NOT_ENOUGH(40009, "余数不足，当前排产剩余数量：{0}"),
    ONLY_ALLOW_SAME_CUSTOMER(40010, "只能选择同一客户的订单"),
    SHIPMENT_NOT_FOUND(40011, "送货单不存在"),
    SHIPMENT_ORDER_NOT_FOUND(400012, "送货单详情不存在"),
    SHIPMENT_CAN_NOT_SIGN(400013, "当前送货单{0}，无法签收"),
    SHIPMENT_CAN_NOT_DELIVERY(400013, "当前送货单{0}，无法发货"),
    OUTSOURCED_ORDER_NOT_FOUND(400014, "外发订单不存在"),
    OUTPUT_REG_REPEAT(400015, "不可重复登记，上次登记数量:{0}"),
    PRODUCT_NOT_FOUND(20017, "产品信息不存在"),
    OUTPUT_REG_REPEAT_ERROR(400016, "存在{0}个登记内容，请先删除后再登记，产品名称:{1}"),

    ;

    private final Integer code;
    private final String message;


    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }
}
